package org.malred.hotelsystem.adapter;

import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentActivity;
import androidx.viewpager2.adapter.FragmentStateAdapter;

import org.malred.hotelsystem.fragment.admin.ManageOrderPageFragment;
import org.malred.hotelsystem.fragment.user.UserOrderPageFragment;

import java.util.ArrayList;
import java.util.List;

public class UserOrderPagerAdapter extends FragmentStateAdapter {
    private List<String> mData = new ArrayList<>();

    public UserOrderPagerAdapter(@NonNull FragmentActivity fragmentActivity, List<String> data) {
        super(fragmentActivity);
        mData = data;
    }

    @NonNull
    @Override
    public Fragment createFragment(int position) {
        return UserOrderPageFragment.newInstance(String.valueOf(position));
    }

    @Override
    public int getItemCount() {
        return mData.size();
    }
}
